/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package arraydemo;

/**
 *
 * @author bw3
 */
public class ArrayDemo {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        // declares an array of integers 
        double[] anArray = {
            100, 200, 300, 400, 500, 600, 700, 800, 900, 1000
        };
        
        int result;
        
  
        System.out.println("Element 1 at index 0: " + anArray[0]);
        System.out.println("Element 2 at index 1: " + anArray[1]);
        System.out.println("Element 3 at index 2: " + anArray[2]);
        System.out.println("Element 4 at index 3: " + anArray[3]);
        System.out.println("Element 5 at index 4: " + anArray[4]);
        System.out.println("Element 6 at index 5: " + anArray[5]);
        System.out.println("Element 7 at index 6: " + anArray[6]);
        System.out.println("Element 8 at index 7: " + anArray[7]);
        System.out.println("Element 9 at index 8: " + anArray[8]);
        System.out.println("Element 10 at index 9: " + anArray[9]);
         
        //give us a result as INT
        result = (int)(anArray[0] + anArray[1]);
        
        System.out.println(result);
        anArray[0] = result;
        
        System.out.println("Element 1 at index 0: " + anArray[0]);
        System.out.println("Element 2 at index 1: " + anArray[1]);
        System.out.println("Element 3 at index 2: " + anArray[2]);
        System.out.println("Element 4 at index 3: " + anArray[3]);
        System.out.println("Element 5 at index 4: " + anArray[4]);
        System.out.println("Element 6 at index 5: " + anArray[5]);
        System.out.println("Element 7 at index 6: " + anArray[6]);
        System.out.println("Element 8 at index 7: " + anArray[7]);
        System.out.println("Element 9 at index 8: " + anArray[8]);
        System.out.println("Element 10 at index 9: " + anArray[9]); 
    }
}
